package net.aiion.weave.spi.xml;

import net.aiion.weave.spi.xml.events.DocumentTypeDefinitionXmlEvent;

public interface XmlGenerator extends XmlSource
{
    XmlQualifiedName createQualifiedName(String aNamespaceURI, String aLocalName);

    XmlQualifiedName createQualifiedName(String aNamespaceURI, String aLocalName, String aPrefix);

    void startDocument(String aVersion, String aEncoding, boolean aStandalone);

    /**
     * Writes a document type declaration with the given ID. A set of common document type declarations is supported.
     * The IDs for these declarations reside in {@link DocumentTypeDefinitionXmlEvent}.
     * 
     * @param aDocumentTypeDeclarationId
     * @return This {@link XmlGenerator}
     * @see DocumentTypeDefinitionXmlEvent
     */
    void declareDocumentType(int aDocumentTypeDeclarationId);

    void declareDocumentType(String aDocumentTypeDeclaration);

    void startElement(String aLocalName);

    void startElement(String aNamespaceURI, String aLocalName);

    void startElement(String aNamespaceURI, String aLocalName, String aPrefix);

    void startElement(XmlQualifiedName aXmlQualifiedName);

    void addAttribute(String aLocalName, String aValue);

    void addAttribute(String aNamespaceURI, String aLocalName, String aValue);

    void addAttribute(String aNamespaceURI, String aLocalName, String aPrefix, String aValue);

    void addAttribute(XmlQualifiedName aXmlQualifiedName, String aValue);

    void addNamespace(String aPrefix, String aNamespaceURI);

    void writeCharacters(String aCharacters);

    void writeCharacters(String aCharacters, int aCharactersDataType);

    void writeComment(String aComment);

    void writeProcessingInstruction(String aTarget, String aData);

    void endElement();

    void endDocument();
}
